function $isNull(val) {
	if (val == null || val == 'null' || val == '') {
		return true;
	} else {
		return false;
	}
}
function $E(id) {
	return document.getElementById(id);
}
function $V(id) {
	return $E(id).value;
}
function $formatAmt(num_old) {
	if (num_old == 0) {
		return '';
	}
	if (num_old == '@null@')
		return '';
	var num = num_old / 100;
	var strarr = num ? num.toString().split('.') : ['0'];
	var pattern = '#,##0.00';
	var fmtarr = pattern ? pattern.split('.') : [''];
	var retstr = '';
	var str = strarr[0];
	var fmt = fmtarr[0];
	var i = str.length - 1;
	var comma = false;
	for (var f = fmt.length - 1; f >= 0; f--) {
		switch (fmt.substr(f, 1)) {
			case '#' :
				if (i >= 0)
					retstr = str.substr(i--, 1) + retstr;
				break;
			case '0' :
				if (i >= 0)
					retstr = str.substr(i--, 1) + retstr;
				else
					retstr = '0' + retstr;
				break;
			case ',' :
				comma = true;
				retstr = ',' + retstr;
				break;
		}
	}
	if (i >= 0) {
		if (comma) {
			var l = str.length;
			for (; i >= 0; i--) {
				retstr = str.substr(i, 1) + retstr;
				if (i > 0 && ((l - i) % 3) == 0)
					retstr = ',' + retstr;
			}
		} else
			retstr = str.substr(0, i + 1) + retstr;
	}

	retstr = retstr + '.';
	str = strarr.length > 1 ? strarr[1] : '00';
	retstr = retstr + str;
	retstr = retstr.replace(/^,+/, '').replace(/\.$/, '').replace('-,', '-');
	return retstr;
}